Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@buzuli/http

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@buzuli/http

HTTP utils for parsing and formatting

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

HTTP utilities

Utils for parsing and formatting HTTP data.

status

const {
  codeInfo,
  codes,
  codesSource,
  color
} = require('@buzuli/http').status

status.codeInfo(code)

Code info record based on the supplied status code if found, else undefined.

status.codes()

List of all status codes. The included fields are:

  • code : the numeric code
  • description : short decription of the status code
  • unofficial : true if not this is not an official status code

status.codesSource()

The URL of the source of the full status code listing.

status.color(code)

Color status codes based on value.

console.info(color(code))

url

const {
  coerce,
  color,
  parse
} = require('@buzuli/http').url

url.coerce(uri)

Attempt to parse a string as a URL (more lenient than parse(url)).

const { host, port, ...rest } = coerce(uri)
console.info(`${host}:${port}`)

url.color(uri)

Make a colorful URL applying unique colors to each component.

console.info(color(uri))

url.parse(url)

Parses a URL applying strict requirements (must have both protocol and host).

Keywords

FAQs

Package last updated on 28 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc